Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Salesforce Apex extension #1449

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

brianevanmiller
Copy link

Provides syntax highlighting for the Salesforce "Apex" language

Copy link

cla-bot bot commented Sep 23, 2024

We require contributors to sign our Contributor License Agreement, and we don't have @brianevanmiller on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@brianevanmiller
Copy link
Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Sep 23, 2024
Copy link

cla-bot bot commented Sep 23, 2024

The cla-bot has been summoned, and re-checked this pull request!

* added Apex to top level extensions
@brianevanmiller
Copy link
Author

@maxdeviant - I fixed the ID mismatch

@maxdeviant
Copy link
Member

It looks like there is an issue with the Tree-sitter grammar:

Error: failed to compile extension

Caused by:
    0: failed to compile grammar 'apex'
    1: failed to compile apex parser with clang: clang: error: no such file or directory: '/home/runner/work/extensions/extensions/extensions/apex/grammars/apex/src/parser.c'
       

    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:[30](https://github.com/zed-industries/extensions/actions/runs/11219620923/job/31185983310?pr=1449#step:11:31)5:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: './zed-extension --scratch-dir ./scratch --source-dir extensions/apex --output-dir output'
}

It looks like the Apex Tree-sitter grammar keeps the grammar in a subdirectory: https://github.com/aheber/tree-sitter-sfapex/tree/943a3eb7f55733929ccafe06841087c3004cb4e0/apex

So you'll to specify that in the path under your grammar config in your extension.toml:

[grammars.apex]
repository = "https://github.com/aheber/tree-sitter-sfapex"
commit = "c99ad4b16d112fea91745e3f1b769754239fdaba"
path = "apex"

@brianevanmiller
Copy link
Author

Thank you @maxdeviant, I added the path in this commit 👍🏻

@maxdeviant
Copy link
Member

Looks like there's a problem in one of the Tree-sitter queries:

[2024-10-08T16:17:21Z INFO  zed_extension] loaded grammar apex
Error: Query error at 13:4. Invalid node type list_initializer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants